Assignemnt #88 and 87th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 87th Program
///File name: Eigh7prog.java
///Date Finished:1/13/2016
import java.util.Scanner;
import java.util.Random;
public class Eigh7prog
{
public static void main( String[] args )
{
Scanner kb = new Scanner(System.in);
int total = 0;
System.out.print( "number: " );
int number = kb.nextInt();
for ( int n = 1; n <= number; n = n + 1 )
{
System.out.print( n + " " );
total = n + total;
System.out.println( "" );
}
System.out.println( "The sum is " + total );
System.out.println( "" );
}
}
Picture of the output